import os.path

import yaml

# 获取根目录的绝对路径
def get_obj_path():
    return os.path.dirname(__file__).split('common')[0]

# 读取yaml文件，将数据转为列表，列表的元素是字典
def read_yaml(yaml_path):
    with open(get_obj_path() + yaml_path, mode='r', encoding='utf-8') as f:
        value = yaml.load(stream=f, Loader=yaml.FullLoader)
        return value

if __name__ == '__main__':
    print(read_yaml('test_cases/intogame/get_token.yaml'))